/**
 * This class returns an array with the xhtml code of an filefield and if set an error, info and a title.
 *
 * @author Redouane Benkaddour <redouane@indago.nl>
 * @version 0.5.2
 * @package reform
 * @subpackage filefield
 */
class filefield extends input_generator {

    /**
    * Constructor of this class wich need a parameter to set the name attribute of the filefield.
    *
    * @param string $name
    * @return void
    */
    public function __construct($name){
    	$this->attribute['name'] = $name;
    }

    /**
    * This function uses a function to generate the xhtml code of a filefield and returns the data in an array
    *
    * @return array $component
    */
    public function create(){
    	if(isset($_REQUEST[$this->attribute['name']])){
    		$this->SetValue($_REQUEST[$this->attribute['name']]);
    	}

    	$this->component['content'] = $this->generateCode('file');
    	return $this->component;
    }
}

?>